﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Delphi.Mimir.Data.Entities.Raw.Mappings {
    public class RawEarningsHistoryMap : EntityTypeConfiguration<RawEarningsHistory> {
        public RawEarningsHistoryMap() {

            /******************************************************************
            /* Table
            /*****************************************************************/
            ToTable("raw.eod_earnings_histories");

            /******************************************************************
            /* Primary Key
            /*****************************************************************/
            HasKey(a => a.aeh_id);

            /******************************************************************
            /* Index
            /*****************************************************************/
            // None

            /******************************************************************
            /* Relationships
            /*****************************************************************/
            // None

            /******************************************************************
            /* Properties
            /*****************************************************************/
            Property(a => a.aeh_id)
                .IsRequired()
                .HasColumnName("aeh_id");

            Property(a => a.aeh_sym_cd)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("aeh_sym_cd");

            Property(a => a.aeh_exc_cd)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("aeh_exc_cd");

            Property(a => a.aeh_dt)
                .IsRequired()
                .HasColumnName("aeh_dt");

            Property(a => a.aeh_eps_est)
                .IsOptional()
                .HasPrecision(18, 6)
                .HasColumnName("aeh_eps_est");

            Property(a => a.aeh_eps_act)
                .IsOptional()
                .HasPrecision(18, 6)
                .HasColumnName("aeh_eps_act");

            Property(a => a.aeh_eps_diff)
                .IsOptional()
                .HasPrecision(18, 6)
                .HasColumnName("aeh_eps_diff");

            Property(a => a.aeh_eps_surp)
                .IsOptional()
                .HasPrecision(18, 6)
                .HasColumnName("aeh_eps_surp");
        }
    }
}
